<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.opengis.net/gml" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" elementFormDefault="qualified" xml:lang="en" version="3.0.0">
  <xsd:annotation>
    <xsd:appinfo source="urn:opengis:specification:gml:schema-dataQuality:v3.0.0"/>
    <xsd:documentation>
      <name>dataQuality.xsd</name>
      <version>3.0</version>
      <scope>How to encode positional data quality information. </scope>
      <description>Builds on measures.xsd to encode the data needed to describe the positional accuracy of coordinate operations. GML 3.0 candidate schema, primary editor: Arliss Whiteside. Last updated 2002/11/21. </description>
      <copyright>Copyright (c) 2001-2002 OpenGIS, All Rights Reserved.</copyright>
      <conformance>This schema encodes the Data Quality (DQ) package of the extended UML Model for OGC Abstract Specification Topic 2: Spatial Referencing by Coordinates. That UML model is adapted from ISO 19111 - Spatial referencing by coordinates, as described in Annex B of Topic 2. </conformance>
    </xsd:documentation>
  </xsd:annotation>
  <!-- ==============================================================
       includes and imports
	============================================================== -->
  <xsd:include schemaLocation="units.xsd"/>
  <!-- ==============================================================
       elements and types
	============================================================== -->
  <xsd:element name="_PositionalAccuracy" type="gml:AbstractPositionalAccuracyType" abstract="true"/>
  <!-- =========================================================== -->
  <xsd:complexType name="AbstractPositionalAccuracyType" abstract="true">
    <xsd:annotation>
      <xsd:documentation>Position error estimate (or accuracy) data. </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="measureDescription" type="string" minOccurs="0">
        <xsd:annotation>
          <xsd:documentation>A description of the position accuracy parameter(s) provided. </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
  <!-- =========================================================== -->
  <xsd:element name="AbsoluteExternalPositionalAccuracy" type="gml:AbsoluteExternalPositionalAccuracyType" substitutionGroup="gml:_PositionalAccuracy"/>
  <!-- =========================================================== -->
  <xsd:complexType name="AbsoluteExternalPositionalAccuracyType">
    <xsd:annotation>
      <xsd:documentation>Closeness of reported coordinate values to values accepted as or being true. </xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="gml:AbstractPositionalAccuracyType">
        <xsd:sequence>
          <xsd:element name="result" type="gml:MeasureType" maxOccurs="2">
            <xsd:annotation>
              <xsd:documentation>Quantitative result determined by evaluation procedure used. </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <!-- =========================================================== -->
  <xsd:element name="RelativeInternalPositionalAccuracy" type="gml:RelativeInternalPositionalAccuracyType" substitutionGroup="gml:_PositionalAccuracy"/>
  <!-- =========================================================== -->
  <xsd:complexType name="RelativeInternalPositionalAccuracyType">
    <xsd:annotation>
      <xsd:documentation>Closeness of the relative positions of two or more positions to their respective relative positions accepted as or being true. </xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="gml:AbstractPositionalAccuracyType">
        <xsd:sequence>
          <xsd:element name="result" type="gml:MeasureType" maxOccurs="2">
            <xsd:annotation>
              <xsd:documentation>Quantitative result determined by evaluation procedure used. </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <!-- =========================================================== -->
  <xsd:element name="CovarianceMatrix" type="gml:CovarianceMatrixType" substitutionGroup="gml:_PositionalAccuracy"/>
  <!-- =========================================================== -->
  <xsd:complexType name="CovarianceMatrixType">
    <xsd:annotation>
      <xsd:documentation>Error estimate covariance matrix. </xsd:documentation>
    </xsd:annotation>
    <xsd:complexContent>
      <xsd:extension base="gml:AbstractPositionalAccuracyType">
        <xsd:sequence>
          <xsd:element ref="gml:unitOfMeasure" maxOccurs="unbounded">
            <xsd:annotation>
              <xsd:documentation>Ordered sequence of units of measure, corresponding to the row and column index numbers of the covariance matrix, starting with row and column 1 and ending with row/column N. Each unit of measure is for the ordinate reflected in the relevant row and column of the covariance matrix. </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
          <xsd:element name="includesElement" type="gml:CovarianceElementType" maxOccurs="unbounded">
            <xsd:annotation>
              <xsd:documentation>Unordered sequence of elements in this covariance matrix. Because the covariance matrix is symmetrical, only the elements in upper or lower diagonal part (including the main diagonal) of the matrix need to be specified. Any zero valued covariance elements can be omitted. </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>
  <!-- =========================================================== -->
  <xsd:complexType name="CovarianceElementType">
    <xsd:annotation>
      <xsd:documentation>An element of a covariance matrix.</xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="rowIndex" type="positiveInteger">
        <xsd:annotation>
          <xsd:documentation>Row number of this covariance element value. </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="columnIndex" type="positiveInteger">
        <xsd:annotation>
          <xsd:documentation>Column number of this covariance element value. </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
      <xsd:element name="covariance" type="double">
        <xsd:annotation>
          <xsd:documentation>Value of covariance element. </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>
